﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PPAP.BO;
using System.Data;
using PPAP.Model;

namespace PPAP.Web.Part
{
    public partial class InapplicableSet : PageBase
    {
        AttachmentTypeBO typebo = new AttachmentTypeBO();
        InapplicableBO ibo = new InapplicableBO();
        SetLevelBO sbo = new SetLevelBO();
        MailTemplateBO mbo = new MailTemplateBO();
        PPARBO pbo = new PPARBO();
        LogBO lbo = new LogBO();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.QueryString["RID"] != null)
                {
                    DataSet ds = typebo.GetList("");
                    LoadType(ds);
                    DataSet ids = ibo.GetList(" pparid="+Request.QueryString["RID"].ToString());
                    LoadFileSet(ids);
                    
                    DataSet ab = typebo.GetAvailable();
                    LoadFileSet3(ab);

                    DataSet sds = sbo.GetList(" type=3 and pparid=" + Request.QueryString["RID"].ToString());
                    if (sds.Tables[0].Rows.Count == 0)
                        sds = typebo.GetIsLevel("3");
                    LoadFileSet2(sds);

                     sds = sbo.GetList(" type=2 and pparid=" + Request.QueryString["RID"].ToString());
                    if (sds.Tables[0].Rows.Count == 0)
                        sds = typebo.GetIsLevel("2");
                    LoadFileSet4(sds);

                    sds = sbo.GetList(" type=1 and pparid=" + Request.QueryString["RID"].ToString());
                    if (sds.Tables[0].Rows.Count == 0)
                        sds = typebo.GetIsLevel("1");
                    LoadFileSet5(sds);
                }
            }
        }


        /// <summary>
        /// 加载附件类型
        /// </summary>
        /// <param name="ds"></param>
        private void LoadType(DataSet ds)
        {
            string TypeName = "";
            int ID = 0;
            int tid = 0;
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                TypeName = dr["ATTACHMENTTYPE"].ToString();
                try
                {
                ID = int.Parse(dr["rownum"].ToString());
                ID = int.Parse(dr["sx"].ToString());
                tid = int.Parse(dr["id"].ToString());

                }
                catch (Exception)
                {
                    ID = 0;
                    tid = 0;
                }
                switch (ID)
                {
                    case 1:
                        lblType1.Text = TypeName;

                        ab1.Visible = true;
                        cb1.Visible = true;
                        db1.Visible = true;
                        eb1.Visible = true;
                        lblType1.Visible = true;
                        lbnum1.Visible = true;
                        ab1.ToolTip = cb1.ToolTip = db1.ToolTip = eb1.ToolTip = tid.ToString();
                        break;
                    case 2:
                        lblType2.Text = TypeName;

                        ab2.Visible = true;
                        cb2.Visible = true;
                        db2.Visible = true;
                        eb2.Visible = true;
                        lblType2.Visible = true;
                        lbnum2.Visible = true;
                        ab2.ToolTip = cb2.ToolTip = db2.ToolTip = eb2.ToolTip = tid.ToString();
                        break;
                    case 3:
                        lblType3.Text = TypeName;

                        ab3.Visible = true;
                        cb3.Visible = true;
                        db3.Visible = true;
                        eb3.Visible = true;
                        lblType3.Visible = true;
                        lbnum3.Visible = true;
                        ab3.ToolTip = cb3.ToolTip = db3.ToolTip = eb3.ToolTip = tid.ToString();
                        break;
                    case 4:
                        lblType4.Text = TypeName;

                        ab4.Visible = true;
                        cb4.Visible = true;
                        db4.Visible = true;
                        eb4.Visible = true;
                        lblType4.Visible = true;
                        lbnum4.Visible = true;
                        ab4.ToolTip = cb4.ToolTip = db4.ToolTip = eb4.ToolTip = tid.ToString();
                        break;
                    case 5:
                        lblType5.Text = TypeName;

                        ab5.Visible = true;
                        cb5.Visible = true;
                        db5.Visible = true;
                        eb5.Visible = true;
                        lblType5.Visible = true;
                        lbnum5.Visible = true;
                        ab5.ToolTip = cb5.ToolTip = db5.ToolTip = eb5.ToolTip = tid.ToString();
                        break;
                    case 6:
                        lblType6.Text = TypeName;

                        ab6.Visible = true;
                        cb6.Visible = true;
                        db6.Visible = true;
                        eb6.Visible = true;
                        lblType6.Visible = true;
                        lbnum6.Visible = true;
                        ab6.ToolTip = cb6.ToolTip = db6.ToolTip = eb6.ToolTip = tid.ToString();
                        break;
                    case 7:
                        lblType7.Text = TypeName;

                        ab7.Visible = true;
                        cb7.Visible = true;
                        db7.Visible = true;
                        eb7.Visible = true;
                        lblType7.Visible = true;
                        lbnum7.Visible = true;
                        ab7.ToolTip = cb7.ToolTip = db7.ToolTip = eb7.ToolTip = tid.ToString();
                        break;
                    case 8:
                        lblType8.Text = TypeName;

                        ab8.Visible = true;
                        cb8.Visible = true;
                        db8.Visible = true;
                        eb8.Visible = true;
                        lblType8.Visible = true;
                        lbnum8.Visible = true;
                        ab8.ToolTip = cb8.ToolTip = db8.ToolTip = eb8.ToolTip = tid.ToString();
                        break;
                    case 9:
                        lblType9.Text = TypeName;

                        ab9.Visible = true;
                        cb9.Visible = true;
                        db9.Visible = true;
                        eb9.Visible = true;
                        lblType9.Visible = true;
                        lbnum9.Visible = true;
                        ab9.ToolTip = cb9.ToolTip = db9.ToolTip = eb9.ToolTip = tid.ToString();
                        break;
                    case 10:
                        lblType10.Text = TypeName;

                        ab10.Visible = true;
                        cb10.Visible = true;
                        db10.Visible = true;
                        eb10.Visible = true;
                        lblType10.Visible = true;
                        lbnum10.Visible = true;
                        ab10.ToolTip = cb10.ToolTip = db10.ToolTip = eb10.ToolTip = tid.ToString();
                        break;
                    case 11:
                        lblType11.Text = TypeName;

                        ab11.Visible = true;
                        cb11.Visible = true;
                        db11.Visible = true;
                        eb11.Visible = true;
                        lblType11.Visible = true;
                        lbnum11.Visible = true;
                        ab11.ToolTip = cb11.ToolTip = db11.ToolTip = eb11.ToolTip = tid.ToString();
                        break;
                    case 12:
                        lblType12.Text = TypeName;

                        ab12.Visible = true;
                        cb12.Visible = true;
                        db12.Visible = true;
                        eb12.Visible = true;
                        lblType12.Visible = true;
                        lbnum12.Visible = true;
                        ab12.ToolTip = cb12.ToolTip = db12.ToolTip = eb12.ToolTip = tid.ToString();
                        break;
                    case 13:
                        lblType13.Text = TypeName;

                        ab13.Visible = true;
                        cb13.Visible = true;
                        db13.Visible = true;
                        eb13.Visible = true;
                        lblType13.Visible = true;
                        lbnum13.Visible = true;
                        ab13.ToolTip = cb13.ToolTip = db13.ToolTip = eb13.ToolTip = tid.ToString();
                        break;
                    case 14:
                        lblType14.Text = TypeName;

                        ab14.Visible = true;
                        cb14.Visible = true;
                        db14.Visible = true;
                        eb14.Visible = true;
                        lblType14.Visible = true;
                        lbnum14.Visible = true;
                        ab14.ToolTip = cb14.ToolTip = db14.ToolTip = eb14.ToolTip = tid.ToString();
                        break;
                    case 15:
                        lblType15.Text = TypeName;

                        ab15.Visible = true;
                        cb15.Visible = true;
                        db15.Visible = true;
                        eb15.Visible = true;
                        lblType15.Visible = true;
                        lbnum15.Visible = true;
                        ab15.ToolTip = cb15.ToolTip = db15.ToolTip = eb15.ToolTip = tid.ToString();
                        break;
                    case 16:
                        lblType16.Text = TypeName;

                        ab16.Visible = true;
                        cb16.Visible = true;
                        db16.Visible = true;
                        eb16.Visible = true;
                        lblType16.Visible = true;
                        lbnum16.Visible = true;
                        ab16.ToolTip = cb16.ToolTip = db16.ToolTip = eb16.ToolTip = tid.ToString();
                        break;
                    case 17:
                        lblType17.Text = TypeName;

                        ab17.Visible = true;
                        cb17.Visible = true;
                        db17.Visible = true;
                        eb17.Visible = true;
                        lblType17.Visible = true;
                        lbnum17.Visible = true;
                        ab17.ToolTip = cb17.ToolTip = db17.ToolTip = eb17.ToolTip = tid.ToString();
                        break;
                    case 18:
                        lblType18.Text = TypeName;

                        ab18.Visible = true;
                        cb18.Visible = true;
                        db18.Visible = true;
                        eb18.Visible = true;
                        lblType18.Visible = true;
                        lbnum18.Visible = true;
                        ab18.ToolTip = cb18.ToolTip = db18.ToolTip = eb18.ToolTip = tid.ToString();
                        break;
                    case 19:
                        lblType19.Text = TypeName;

                        ab19.Visible = true;
                        cb19.Visible = true;
                        db19.Visible = true;
                        eb19.Visible = true;
                        lblType19.Visible = true;
                        lbnum19.Visible = true;
                        ab19.ToolTip = cb19.ToolTip = db19.ToolTip = eb19.ToolTip = tid.ToString();
                        break;
                    case 20:
                        lblType20.Text = TypeName;

                        ab20.Visible = true;
                        cb20.Visible = true;
                        db20.Visible = true;
                        eb20.Visible = true;
                        lblType20.Visible = true;
                        lbnum20.Visible = true;
                        ab20.ToolTip = cb20.ToolTip = db20.ToolTip = eb20.ToolTip = tid.ToString();
                        break;
                    case 21:
                        lblType21.Text = TypeName;

                        ab21.Visible = true;
                        cb21.Visible = true;
                        db21.Visible = true;
                        eb21.Visible = true;
                        lblType21.Visible = true;
                        lbnum21.Visible = true;
                        ab21.ToolTip = cb21.ToolTip = db21.ToolTip = eb21.ToolTip = tid.ToString();
                        break;
                    case 22:
                        lblType22.Text = TypeName;

                        ab22.Visible = true;
                        cb22.Visible = true;
                        db22.Visible = true;
                        eb22.Visible = true;
                        lblType22.Visible = true;
                        lbnum22.Visible = true;
                        ab22.ToolTip = cb22.ToolTip = db22.ToolTip = eb22.ToolTip = tid.ToString();
                        break;
                    case 23:
                        lblType23.Text = TypeName;

                        ab23.Visible = true;
                        cb23.Visible = true;
                        db23.Visible = true;
                        eb23.Visible = true;
                        lblType23.Visible = true;
                        lbnum23.Visible = true;
                        ab23.ToolTip = cb23.ToolTip = db23.ToolTip = eb23.ToolTip = tid.ToString();
                        break;
                    case 24:
                        lblType24.Text = TypeName;

                        ab24.Visible = true;
                        cb24.Visible = true;
                        db24.Visible = true;
                        eb24.Visible = true;
                        lblType24.Visible = true;
                        lbnum24.Visible = true;
                        ab24.ToolTip = cb24.ToolTip = db24.ToolTip = eb24.ToolTip = tid.ToString();
                        break;
                    case 25:
                        lblType25.Text = TypeName;

                        ab25.Visible = true;
                        cb25.Visible = true;
                        db25.Visible = true;
                        eb25.Visible = true;
                        lblType25.Visible = true;
                        lbnum25.Visible = true;
                        ab25.ToolTip = cb25.ToolTip = db25.ToolTip = eb25.ToolTip = tid.ToString();
                        break;
                    case 26:
                        lblType26.Text = TypeName;

                        ab26.Visible = true;
                        cb26.Visible = true;
                        db26.Visible = true;
                        eb26.Visible = true;
                        lblType26.Visible = true;
                        lbnum26.Visible = true;
                        ab26.ToolTip = cb26.ToolTip = db26.ToolTip = eb26.ToolTip = tid.ToString();
                        break;
                    case 27:
                        lblType27.Text = TypeName;

                        ab27.Visible = true;
                        cb27.Visible = true;
                        db27.Visible = true;
                        eb27.Visible = true;
                        lblType27.Visible = true;
                        lbnum27.Visible = true;
                        ab27.ToolTip = cb27.ToolTip = db27.ToolTip = eb27.ToolTip = tid.ToString();
                        break;
                    case 28:
                        lblType28.Text = TypeName;

                        ab28.Visible = true;
                        cb28.Visible = true;
                        db28.Visible = true;
                        eb28.Visible = true;
                        lblType28.Visible = true;
                        lbnum28.Visible = true;
                        ab28.ToolTip = cb28.ToolTip = db28.ToolTip = eb28.ToolTip = tid.ToString();
                        break;
                    case 29:
                        lblType29.Text = TypeName;

                        ab29.Visible = true;
                        cb29.Visible = true;
                        db29.Visible = true;
                        eb29.Visible = true;
                        lblType29.Visible = true;
                        lbnum29.Visible = true;
                        ab29.ToolTip = cb29.ToolTip = db29.ToolTip = eb29.ToolTip = tid.ToString();
                        break;
                    case 30:
                        lblType30.Text = TypeName;

                        ab30.Visible = true;
                        cb30.Visible = true;
                        db30.Visible = true;
                        eb30.Visible = true;
                        lblType30.Visible = true;
                        lbnum30.Visible = true;
                        ab30.ToolTip = cb30.ToolTip = db30.ToolTip = eb30.ToolTip = tid.ToString();
                        break;
                    case 31:
                        lblType31.Text = TypeName;

                        ab31.Visible = true;
                        cb31.Visible = true;
                        db31.Visible = true;
                        eb31.Visible = true;
                        lblType31.Visible = true;
                        lbnum31.Visible = true;
                        ab31.ToolTip = cb31.ToolTip = db31.ToolTip = eb31.ToolTip = tid.ToString();
                        break;
                    case 32:
                        lblType32.Text = TypeName;

                        ab32.Visible = true;
                        cb32.Visible = true;
                        db32.Visible = true;
                        eb32.Visible = true;
                        lblType32.Visible = true;
                        lbnum32.Visible = true;
                        ab32.ToolTip = cb32.ToolTip = db32.ToolTip = eb32.ToolTip = tid.ToString();
                        break;
                    case 33:
                        lblType33.Text = TypeName;

                        ab33.Visible = true;
                        cb33.Visible = true;
                        db33.Visible = true;
                        eb33.Visible = true;
                        lblType33.Visible = true;
                        lbnum33.Visible = true;
                        ab33.ToolTip = cb33.ToolTip = db33.ToolTip = eb33.ToolTip = tid.ToString();
                        break;
                    case 34:
                        lblType34.Text = TypeName;

                        ab34.Visible = true;
                        cb34.Visible = true;
                        db34.Visible = true;
                        eb34.Visible = true;
                        lblType34.Visible = true;
                        lbnum34.Visible = true;
                        ab34.ToolTip = cb34.ToolTip = db34.ToolTip = eb34.ToolTip = tid.ToString();
                        break;
                    case 35:
                        lblType35.Text = TypeName;

                        ab35.Visible = true;
                        cb35.Visible = true;
                        db35.Visible = true;
                        eb35.Visible = true;
                        lblType35.Visible = true;
                        lbnum35.Visible = true;
                        ab35.ToolTip = cb35.ToolTip = db35.ToolTip = eb35.ToolTip = tid.ToString();
                        break;
                    case 36:
                        lblType36.Text = TypeName;

                        ab36.Visible = true;
                        cb36.Visible = true;
                        db36.Visible = true;
                        eb36.Visible = true;
                        lblType36.Visible = true;
                        lbnum36.Visible = true;
                        ab36.ToolTip = cb36.ToolTip = db36.ToolTip = eb36.ToolTip = tid.ToString();
                        break;
                    case 37:
                        lblType37.Text = TypeName;

                        ab37.Visible = true;
                        cb37.Visible = true;
                        db37.Visible = true;
                        eb37.Visible = true;
                        lblType37.Visible = true;
                        lbnum37.Visible = true;
                        ab37.ToolTip = cb37.ToolTip = db37.ToolTip = eb37.ToolTip = tid.ToString();
                        break;
                    case 38:
                        lblType38.Text = TypeName;

                        ab38.Visible = true;
                        cb38.Visible = true;
                        db38.Visible = true;
                        eb38.Visible = true;
                        lblType38.Visible = true;
                        lbnum38.Visible = true;
                        ab38.ToolTip = cb38.ToolTip = db38.ToolTip = eb38.ToolTip = tid.ToString();
                        break;
                    case 39:
                        lblType39.Text = TypeName;

                        ab39.Visible = true;
                        cb39.Visible = true;
                        db39.Visible = true;
                        eb39.Visible = true;
                        lblType39.Visible = true;
                        lbnum39.Visible = true;
                        ab39.ToolTip = cb39.ToolTip = db39.ToolTip = eb39.ToolTip = tid.ToString();
                        break;
                    case 40:
                        lblType40.Text = TypeName;

                        ab40.Visible = true;
                        cb40.Visible = true;
                        db40.Visible = true;
                        eb40.Visible = true;
                        lblType40.Visible = true;
                        lbnum40.Visible = true;
                        ab40.ToolTip = cb40.ToolTip = db40.ToolTip = eb40.ToolTip = tid.ToString();
                        break;
                    case 41:
                        lblType41.Text = TypeName;

                        ab41.Visible = true;
                        cb41.Visible = true;
                        db41.Visible = true;
                        eb41.Visible = true;
                        lblType41.Visible = true;
                        lbnum41.Visible = true;
                        ab41.ToolTip = cb41.ToolTip = db41.ToolTip = eb41.ToolTip = tid.ToString();
                        break;
                    case 42:
                        lblType42.Text = TypeName;

                        ab42.Visible = true;
                        cb42.Visible = true;
                        db42.Visible = true;
                        eb42.Visible = true;
                        lblType42.Visible = true;
                        lbnum42.Visible = true;
                        ab42.ToolTip = cb42.ToolTip = db42.ToolTip = eb42.ToolTip = tid.ToString();
                        break;
                    case 43:
                        lblType43.Text = TypeName;

                        ab43.Visible = true;
                        cb43.Visible = true;
                        db43.Visible = true;
                        eb43.Visible = true;
                        lblType43.Visible = true;
                        lbnum43.Visible = true;
                        ab43.ToolTip = cb43.ToolTip = db43.ToolTip = eb43.ToolTip = tid.ToString();
                        break;
                    case 44:
                        lblType44.Text = TypeName;

                        ab44.Visible = true;
                        cb44.Visible = true;
                        db44.Visible = true;
                        eb44.Visible = true;
                        lblType44.Visible = true;
                        lbnum44.Visible = true;
                        ab44.ToolTip = cb44.ToolTip = db44.ToolTip = eb44.ToolTip = tid.ToString();
                        break;
                    case 45:
                        lblType45.Text = TypeName;

                        ab45.Visible = true;
                        cb45.Visible = true;
                        db45.Visible = true;
                        eb45.Visible = true;
                        lblType45.Visible = true;
                        lbnum45.Visible = true;
                        ab45.ToolTip = cb45.ToolTip = db45.ToolTip = eb45.ToolTip = tid.ToString();
                        break;
                    case 46:
                        lblType46.Text = TypeName;

                        ab46.Visible = true;
                        cb46.Visible = true;
                        db46.Visible = true;
                        eb46.Visible = true;
                        lblType46.Visible = true;
                        lbnum46.Visible = true;
                        ab46.ToolTip = cb46.ToolTip = db46.ToolTip = eb46.ToolTip = tid.ToString();
                        break;
                    case 47:
                        lblType47.Text = TypeName;

                        ab47.Visible = true;
                        cb47.Visible = true;
                        db47.Visible = true;
                        eb47.Visible = true;
                        lblType47.Visible = true;
                        lbnum47.Visible = true;
                        ab47.ToolTip = cb47.ToolTip = db47.ToolTip = eb47.ToolTip = tid.ToString();
                        break;
                    case 48:
                        lblType48.Text = TypeName;

                        ab48.Visible = true;
                        cb48.Visible = true;
                        db48.Visible = true;
                        eb48.Visible = true;
                        lblType48.Visible = true;
                        lbnum48.Visible = true;
                        ab48.ToolTip = cb48.ToolTip = db48.ToolTip = eb48.ToolTip = tid.ToString();
                        break;
                    case 49:
                        lblType49.Text = TypeName;

                        ab49.Visible = true;
                        cb49.Visible = true;
                        db49.Visible = true;
                        eb49.Visible = true;
                        lblType49.Visible = true;
                        lbnum49.Visible = true;
                        ab49.ToolTip = cb49.ToolTip = db49.ToolTip = eb49.ToolTip = tid.ToString();
                        break;
                    case 50:
                        lblType50.Text = TypeName;

                        ab50.Visible = true;
                        cb50.Visible = true;
                        db50.Visible = true;
                        eb50.Visible = true;
                        lblType50.Visible = true;
                        lbnum50.Visible = true;
                        ab50.ToolTip = cb50.ToolTip = db50.ToolTip = eb50.ToolTip = tid.ToString();
                        break;
                    case 51:
                        lblType51.Text = TypeName;

                        ab51.Visible = true;
                        cb51.Visible = true;
                        db51.Visible = true;
                        eb51.Visible = true;
                        lblType51.Visible = true;
                        lbnum51.Visible = true;
                        ab51.ToolTip = cb51.ToolTip = db51.ToolTip = eb51.ToolTip = tid.ToString();
                        break;
                    case 52:
                        lblType52.Text = TypeName;

                        ab52.Visible = true;
                        cb52.Visible = true;
                        db52.Visible = true;
                        eb52.Visible = true;
                        lblType52.Visible = true;
                        lbnum52.Visible = true;
                        ab52.ToolTip = cb52.ToolTip = db52.ToolTip = eb52.ToolTip = tid.ToString();
                        break;
                    case 53:
                        lblType53.Text = TypeName;

                        ab53.Visible = true;
                        cb53.Visible = true;
                        db53.Visible = true;
                        eb53.Visible = true;
                        lblType53.Visible = true;
                        lbnum53.Visible = true;
                        ab53.ToolTip = cb53.ToolTip = db53.ToolTip = eb53.ToolTip = tid.ToString();
                        break;
                    case 54:
                        lblType54.Text = TypeName;

                        ab54.Visible = true;
                        cb54.Visible = true;
                        db54.Visible = true;
                        eb54.Visible = true;
                        lblType54.Visible = true;
                        lbnum54.Visible = true;
                        ab54.ToolTip = cb54.ToolTip = db54.ToolTip = eb54.ToolTip = tid.ToString();
                        break;
                    case 55:
                        lblType55.Text = TypeName;

                        ab55.Visible = true;
                        cb55.Visible = true;
                        db55.Visible = true;
                        eb55.Visible = true;
                        lblType55.Visible = true;
                        lbnum55.Visible = true;
                        ab55.ToolTip = cb55.ToolTip = db55.ToolTip = eb55.ToolTip = tid.ToString();
                        break;
                    case 56:
                        lblType56.Text = TypeName;

                        ab56.Visible = true;
                        cb56.Visible = true;
                        db56.Visible = true;
                        eb56.Visible = true;
                        lblType56.Visible = true;
                        lbnum56.Visible = true;
                        ab56.ToolTip = cb56.ToolTip = db56.ToolTip = eb56.ToolTip = tid.ToString();
                        break;
                    case 57:
                        lblType57.Text = TypeName;

                        ab57.Visible = true;
                        cb57.Visible = true;
                        db57.Visible = true;
                        eb57.Visible = true;
                        lblType57.Visible = true;
                        lbnum57.Visible = true;
                        ab57.ToolTip = cb57.ToolTip = db57.ToolTip = eb57.ToolTip = tid.ToString();
                        break;
                    case 58:
                        lblType58.Text = TypeName;

                        ab58.Visible = true;
                        cb58.Visible = true;
                        db58.Visible = true;
                        eb58.Visible = true;
                        lblType58.Visible = true;
                        lbnum58.Visible = true;
                        ab58.ToolTip = cb58.ToolTip = db58.ToolTip = eb58.ToolTip = tid.ToString();
                        break;
                    case 59:
                        lblType59.Text = TypeName;

                        ab59.Visible = true;
                        cb59.Visible = true;
                        db59.Visible = true;
                        eb59.Visible = true;
                        lblType59.Visible = true;
                        lbnum59.Visible = true;
                        ab59.ToolTip = cb59.ToolTip = db59.ToolTip = eb59.ToolTip = tid.ToString();
                        break;
                    case 60:
                        lblType60.Text = TypeName;

                        ab60.Visible = true;
                        cb60.Visible = true;
                        db60.Visible = true;
                        eb60.Visible = true;
                        lblType60.Visible = true;
                        lbnum60.Visible = true;
                        ab60.ToolTip = cb60.ToolTip = db60.ToolTip = eb60.ToolTip = tid.ToString();
                        break;
                    default:
                        break;
                }
            }
        }

        /// <summary>
        /// 加载不需要上传的附件类型
        /// </summary>
        /// <param name="ds"></param>
        private void LoadFileSet(DataSet ds)
        {
            int ID = 0;
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                try
                {

                 ID = int.Parse(dr["sx"].ToString());
                }
                catch (Exception)
                {
                    ID = 0;
                }
                switch (ID)
                {
                    case 1:
                        CheckBox1.Checked = true;
                        break;
                    case 2:
                        CheckBox2.Checked = true;
                        break;
                    case 3:
                        CheckBox3.Checked = true;
                        break;
                    case 4:
                        CheckBox4.Checked = true;
                        break;
                    case 5:
                        CheckBox5.Checked = true;
                        break;
                    case 6:
                        CheckBox6.Checked = true;
                        break;
                    case 7:
                        CheckBox7.Checked = true;
                        break;
                    case 8:
                        CheckBox8.Checked = true;
                        break;
                    case 9:
                        CheckBox9.Checked = true;
                        break;
                    case 10:
                        CheckBox10.Checked = true;
                        break;
                    case 11:
                        CheckBox11.Checked = true;
                        break;
                    case 12:
                        CheckBox12.Checked = true;
                        break;
                    case 13:
                        CheckBox13.Checked = true;
                        break;
                    case 14:
                        CheckBox14.Checked = true;
                        break;
                    case 15:
                        CheckBox15.Checked = true;
                        break;
                    case 16:
                        CheckBox16.Checked = true;
                        break;
                    case 17:
                        CheckBox17.Checked = true;
                        break;
                    case 18:
                        CheckBox18.Checked = true;
                        break;
                    case 19:
                        CheckBox19.Checked = true;
                        break;
                    case 20:
                        CheckBox20.Checked = true;
                        break;
                    case 21:
                        CheckBox21.Checked = true;
                        break;
                    case 22:
                        CheckBox22.Checked = true;
                        break;
                    case 23:
                        CheckBox23.Checked = true;
                        break;
                    case 24:
                        CheckBox24.Checked = true;
                        break;
                    case 25:
                        CheckBox25.Checked = true;
                        break;
                    case 26:
                        CheckBox26.Checked = true;
                        break;
                    case 27:
                        CheckBox27.Checked = true;
                        break;
                    case 28:
                        CheckBox28.Checked = true;
                        break;
                    case 29:
                        CheckBox29.Checked = true;
                        break;
                    case 30:
                        CheckBox30.Checked = true;
                        break;
                    case 31:
                        CheckBox31.Checked = true;
                        break;
                    case 32:
                        CheckBox32.Checked = true;
                        break;
                    case 33:
                        CheckBox33.Checked = true;
                        break;
                    case 34:
                        CheckBox34.Checked = true;
                        break;
                    case 35:
                        CheckBox35.Checked = true;
                        break;
                    case 36:
                        CheckBox36.Checked = true;
                        break;
                    case 37:
                        CheckBox37.Checked = true;
                        break;
                    case 38:
                        CheckBox38.Checked = true;
                        break;
                    case 39:
                        CheckBox39.Checked = true;
                        break;
                    case 40:
                        CheckBox40.Checked = true;
                        break;
                    case 41:
                        CheckBox41.Checked = true;
                        break;
                    case 42:
                        CheckBox42.Checked = true;
                        break;
                    case 43:
                        CheckBox43.Checked = true;
                        break;
                    case 44:
                        CheckBox44.Checked = true;
                        break;
                    case 45:
                        CheckBox45.Checked = true;
                        break;
                    case 46:
                        CheckBox46.Checked = true;
                        break;
                    case 47:
                        CheckBox47.Checked = true;
                        break;
                    case 48:
                        CheckBox48.Checked = true;
                        break;
                    case 49:
                        CheckBox49.Checked = true;
                        break;
                    case 50:
                        CheckBox50.Checked = true;
                        break;
                    case 51:
                        CheckBox51.Checked = true;
                        break;
                    case 52:
                        CheckBox52.Checked = true;
                        break;
                    case 53:
                        CheckBox53.Checked = true;
                        break;
                    case 54:
                        CheckBox54.Checked = true;
                        break;
                    case 55:
                        CheckBox55.Checked = true;
                        break;
                    case 56:
                        CheckBox56.Checked = true;
                        break;
                    case 57:
                        CheckBox57.Checked = true;
                        break;
                    case 58:
                        CheckBox58.Checked = true;
                        break;
                    case 59:
                        CheckBox59.Checked = true;
                        break;
                    case 60:
                        CheckBox60.Checked = true;
                        break;
                    default:
                        break;
                }
            }
        }

        /// <summary>
        /// 加载不需要上传的附件类型  默认全部选中 level3
        /// </summary>
        /// <param name="ds"></param>
        private void LoadFileSet2(DataSet ds)
        {
            int ID = 0;
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                try
                {

                
                ID = int.Parse(dr["rid"].ToString());
                ID = int.Parse(dr["sx"].ToString());
                }
                catch (Exception)
                {
                    ID = 0;
                }
                switch (ID)
                {
                    case 1:
                        cb1.Checked = false;
                        break;
                    case 2:
                        cb2.Checked = false;
                        break;
                    case 3:
                        cb3.Checked = false;
                        break;
                    case 4:
                        cb4.Checked = false;
                        break;
                    case 5:
                        cb5.Checked = false;
                        break;
                    case 6:
                        cb6.Checked = false;
                        break;
                    case 7:
                        cb7.Checked = false;
                        break;
                    case 8:
                        cb8.Checked = false;
                        break;
                    case 9:
                        cb9.Checked = false;
                        break;
                    case 10:
                        cb10.Checked = false;
                        break;
                    case 11:
                        cb11.Checked = false;
                        break;
                    case 12:
                        cb12.Checked = false;
                        break;
                    case 13:
                        cb13.Checked = false;
                        break;
                    case 14:
                        cb14.Checked = false;
                        break;
                    case 15:
                        cb15.Checked = false;
                        break;
                    case 16:
                        cb16.Checked = false;
                        break;
                    case 17:
                        cb17.Checked = false;
                        break;
                    case 18:
                        cb18.Checked = false;
                        break;
                    case 19:
                        cb19.Checked = false;
                        break;
                    case 20:
                        cb20.Checked = false;
                        break;
                    case 21:
                        cb21.Checked = false;
                        break;
                    case 22:
                        cb22.Checked = false;
                        break;
                    case 23:
                        cb23.Checked = false;
                        break;
                    case 24:
                        cb24.Checked = false;
                        break;
                    case 25:
                        cb25.Checked = false;
                        break;
                    case 26:
                        cb26.Checked = false;
                        break;
                    case 27:
                        cb27.Checked = false;
                        break;
                    case 28:
                        cb28.Checked = false;
                        break;
                    case 29:
                        cb29.Checked = false;
                        break;
                    case 30:
                        cb30.Checked = false;
                        break;
                    case 31:
                        cb31.Checked = false;
                        break;
                    case 32:
                        cb32.Checked = false;
                        break;
                    case 33:
                        cb33.Checked = false;
                        break;
                    case 34:
                        cb34.Checked = false;
                        break;
                    case 35:
                        cb35.Checked = false;
                        break;
                    case 36:
                        cb36.Checked = false;
                        break;
                    case 37:
                        cb37.Checked = false;
                        break;
                    case 38:
                        cb38.Checked = false;
                        break;
                    case 39:
                        cb39.Checked = false;
                        break;
                    case 40:
                        cb40.Checked = false;
                        break;
                    case 41:
                        cb41.Checked = false;
                        break;
                    case 42:
                        cb42.Checked = false;
                        break;
                    case 43:
                        cb43.Checked = false;
                        break;
                    case 44:
                        cb44.Checked = false;
                        break;
                    case 45:
                        cb45.Checked = false;
                        break;
                    case 46:
                        cb46.Checked = false;
                        break;
                    case 47:
                        cb47.Checked = false;
                        break;
                    case 48:
                        cb48.Checked = false;
                        break;
                    case 49:
                        cb49.Checked = false;
                        break;
                    case 50:
                        cb50.Checked = false;
                        break;
                    case 51:
                        cb51.Checked = false;
                        break;
                    case 52:
                        cb52.Checked = false;
                        break;
                    case 53:
                        cb53.Checked = false;
                        break;
                    case 54:
                        cb54.Checked = false;
                        break;
                    case 55:
                        cb55.Checked = false;
                        break;
                    case 56:
                        cb56.Checked = false;
                        break;
                    case 57:
                        cb57.Checked = false;
                        break;
                    case 58:
                        cb58.Checked = false;
                        break;
                    case 59:
                        cb59.Checked = false;
                        break;
                    case 60:
                        cb60.Checked = false;
                        break;
                    default:
                        break;
                }
            }
        }

        /// <summary>
        /// 加载不需要上传的附件类型  默认全部选中 level2
        /// </summary>
        /// <param name="ds"></param>
        private void LoadFileSet4(DataSet ds)
        {
            int ID = 0;
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                try
                {

               
                ID = int.Parse(dr["rid"].ToString());
                ID = int.Parse(dr["sx"].ToString());
                }
                catch (Exception)
                {
                    ID = 0;
                }
                switch (ID)
                {
                    case 1:
                        eb1.Checked = false;
                        break;
                    case 2:
                        eb2.Checked = false;
                        break;
                    case 3:
                        eb3.Checked = false;
                        break;
                    case 4:
                        eb4.Checked = false;
                        break;
                    case 5:
                        eb5.Checked = false;
                        break;
                    case 6:
                        eb6.Checked = false;
                        break;
                    case 7:
                        eb7.Checked = false;
                        break;
                    case 8:
                        eb8.Checked = false;
                        break;
                    case 9:
                        eb9.Checked = false;
                        break;
                    case 10:
                        eb10.Checked = false;
                        break;
                    case 11:
                        eb11.Checked = false;
                        break;
                    case 12:
                        eb12.Checked = false;
                        break;
                    case 13:
                        eb13.Checked = false;
                        break;
                    case 14:
                        eb14.Checked = false;
                        break;
                    case 15:
                        eb15.Checked = false;
                        break;
                    case 16:
                        eb16.Checked = false;
                        break;
                    case 17:
                        eb17.Checked = false;
                        break;
                    case 18:
                        eb18.Checked = false;
                        break;
                    case 19:
                        eb19.Checked = false;
                        break;
                    case 20:
                        eb20.Checked = false;
                        break;
                    case 21:
                        eb21.Checked = false;
                        break;
                    case 22:
                        eb22.Checked = false;
                        break;
                    case 23:
                        eb23.Checked = false;
                        break;
                    case 24:
                        eb24.Checked = false;
                        break;
                    case 25:
                        eb25.Checked = false;
                        break;
                    case 26:
                        eb26.Checked = false;
                        break;
                    case 27:
                        eb27.Checked = false;
                        break;
                    case 28:
                        eb28.Checked = false;
                        break;
                    case 29:
                        eb29.Checked = false;
                        break;
                    case 30:
                        eb30.Checked = false;
                        break;
                    case 31:
                        eb31.Checked = false;
                        break;
                    case 32:
                        eb32.Checked = false;
                        break;
                    case 33:
                        eb33.Checked = false;
                        break;
                    case 34:
                        eb34.Checked = false;
                        break;
                    case 35:
                        eb35.Checked = false;
                        break;
                    case 36:
                        eb36.Checked = false;
                        break;
                    case 37:
                        eb37.Checked = false;
                        break;
                    case 38:
                        eb38.Checked = false;
                        break;
                    case 39:
                        eb39.Checked = false;
                        break;
                    case 40:
                        eb40.Checked = false;
                        break;
                    case 41:
                        eb41.Checked = false;
                        break;
                    case 42:
                        eb42.Checked = false;
                        break;
                    case 43:
                        eb43.Checked = false;
                        break;
                    case 44:
                        eb44.Checked = false;
                        break;
                    case 45:
                        eb45.Checked = false;
                        break;
                    case 46:
                        eb46.Checked = false;
                        break;
                    case 47:
                        eb47.Checked = false;
                        break;
                    case 48:
                        eb48.Checked = false;
                        break;
                    case 49:
                        eb49.Checked = false;
                        break;
                    case 50:
                        eb50.Checked = false;
                        break;
                    case 51:
                        eb51.Checked = false;
                        break;
                    case 52:
                        eb52.Checked = false;
                        break;
                    case 53:
                        eb53.Checked = false;
                        break;
                    case 54:
                        eb54.Checked = false;
                        break;
                    case 55:
                        eb55.Checked = false;
                        break;
                    case 56:
                        eb56.Checked = false;
                        break;
                    case 57:
                        eb57.Checked = false;
                        break;
                    case 58:
                        eb58.Checked = false;
                        break;
                    case 59:
                        eb59.Checked = false;
                        break;
                    case 60:
                        eb60.Checked = false;
                        break;
                    default:
                        break;
                }
            }
        }

        /// <summary>
        /// 加载不需要上传的附件类型  默认全部选中 level1
        /// </summary>
        /// <param name="ds"></param>
        private void LoadFileSet5(DataSet ds)
        {
            int ID = 0;
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                try
                {

               
                ID = int.Parse(dr["rid"].ToString());
                ID = int.Parse(dr["sx"].ToString());
                }
                catch (Exception)
                {
                    ID = 0;
                }
                switch (ID)
                {
                    case 1:
                        db1.Checked = false;
                        break;
                    case 2:
                        db2.Checked = false;
                        break;
                    case 3:
                        db3.Checked = false;
                        break;
                    case 4:
                        db4.Checked = false;
                        break;
                    case 5:
                        db5.Checked = false;
                        break;
                    case 6:
                        db6.Checked = false;
                        break;
                    case 7:
                        db7.Checked = false;
                        break;
                    case 8:
                        db8.Checked = false;
                        break;
                    case 9:
                        db9.Checked = false;
                        break;
                    case 10:
                        db10.Checked = false;
                        break;
                    case 11:
                        db11.Checked = false;
                        break;
                    case 12:
                        db12.Checked = false;
                        break;
                    case 13:
                        db13.Checked = false;
                        break;
                    case 14:
                        db14.Checked = false;
                        break;
                    case 15:
                        db15.Checked = false;
                        break;
                    case 16:
                        db16.Checked = false;
                        break;
                    case 17:
                        db17.Checked = false;
                        break;
                    case 18:
                        db18.Checked = false;
                        break;
                    case 19:
                        db19.Checked = false;
                        break;
                    case 20:
                        db20.Checked = false;
                        break;
                    case 21:
                        db21.Checked = false;
                        break;
                    case 22:
                        db22.Checked = false;
                        break;
                    case 23:
                        db23.Checked = false;
                        break;
                    case 24:
                        db24.Checked = false;
                        break;
                    case 25:
                        db25.Checked = false;
                        break;
                    case 26:
                        db26.Checked = false;
                        break;
                    case 27:
                        db27.Checked = false;
                        break;
                    case 28:
                        db28.Checked = false;
                        break;
                    case 29:
                        db29.Checked = false;
                        break;
                    case 30:
                        db30.Checked = false;
                        break;
                    case 31:
                        db31.Checked = false;
                        break;
                    case 32:
                        db32.Checked = false;
                        break;
                    case 33:
                        db33.Checked = false;
                        break;
                    case 34:
                        db34.Checked = false;
                        break;
                    case 35:
                        db35.Checked = false;
                        break;
                    case 36:
                        db36.Checked = false;
                        break;
                    case 37:
                        db37.Checked = false;
                        break;
                    case 38:
                        db38.Checked = false;
                        break;
                    case 39:
                        db39.Checked = false;
                        break;
                    case 40:
                        db40.Checked = false;
                        break;
                    case 41:
                        db41.Checked = false;
                        break;
                    case 42:
                        db42.Checked = false;
                        break;
                    case 43:
                        db43.Checked = false;
                        break;
                    case 44:
                        db44.Checked = false;
                        break;
                    case 45:
                        db45.Checked = false;
                        break;
                    case 46:
                        db46.Checked = false;
                        break;
                    case 47:
                        db47.Checked = false;
                        break;
                    case 48:
                        db48.Checked = false;
                        break;
                    case 49:
                        db49.Checked = false;
                        break;
                    case 50:
                        db50.Checked = false;
                        break;
                    case 51:
                        db51.Checked = false;
                        break;
                    case 52:
                        db52.Checked = false;
                        break;
                    case 53:
                        db53.Checked = false;
                        break;
                    case 54:
                        db54.Checked = false;
                        break;
                    case 55:
                        db55.Checked = false;
                        break;
                    case 56:
                        db56.Checked = false;
                        break;
                    case 57:
                        db57.Checked = false;
                        break;
                    case 58:
                        db58.Checked = false;
                        break;
                    case 59:
                        db59.Checked = false;
                        break;
                    case 60:
                        db60.Checked = false;
                        break;
                    default:
                        break;
                }
            }
        }

        private void LoadFileSet3(DataSet ds)
        {
            int ID = 0;
            bool check = false;
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                try
                {

                ID = int.Parse(dr["rownum"].ToString());
                ID = int.Parse(dr["sx"].ToString());
                }
                catch (Exception)
                {
                    ID = 0;
                }
                check = dr["bdnttemplateavailable"].ToString() == "1" ? true : false;
                switch (ID)
                {
                    case 1:
                        ab1.Checked = check;
                        break;
                    case 2:
                        ab2.Checked = check;
                        break;
                    case 3:
                        ab3.Checked = check;
                        break;
                    case 4:
                        ab4.Checked = check;
                        break;
                    case 5:
                        ab5.Checked = check;
                        break;
                    case 6:
                        ab6.Checked = check;
                        break;
                    case 7:
                        ab7.Checked = check;
                        break;
                    case 8:
                        ab8.Checked = check;
                        break;
                    case 9:
                        ab9.Checked = check;
                        break;
                    case 10:
                        ab10.Checked = check;
                        break;
                    case 11:
                        ab11.Checked = check;
                        break;
                    case 12:
                        ab12.Checked = check;
                        break;
                    case 13:
                        ab13.Checked = check;
                        break;
                    case 14:
                        ab14.Checked = check;
                        break;
                    case 15:
                        ab15.Checked = check;
                        break;
                    case 16:
                        ab16.Checked = check;
                        break;
                    case 17:
                        ab17.Checked = check;
                        break;
                    case 18:
                        ab18.Checked = check;
                        break;
                    case 19:
                        ab19.Checked = check;
                        break;
                    case 20:
                        ab20.Checked = check;
                        break;
                    case 21:
                        ab21.Checked = check;
                        break;
                    case 22:
                        ab22.Checked = check;
                        break;
                    case 23:
                        ab23.Checked = check;
                        break;
                    case 24:
                        ab24.Checked = check;
                        break;
                    case 25:
                        ab25.Checked = check;
                        break;
                    case 26:
                        ab26.Checked = check;
                        break;
                    case 27:
                        ab27.Checked = check;
                        break;
                    case 28:
                        ab28.Checked = check;
                        break;
                    case 29:
                        ab29.Checked = check;
                        break;
                    case 30:
                        ab30.Checked = check;
                        break;
                    case 31:
                        ab31.Checked = check;
                        break;
                    case 32:
                        ab32.Checked = check;
                        break;
                    case 33:
                        ab33.Checked = check;
                        break;
                    case 34:
                        ab34.Checked = check;
                        break;
                    case 35:
                        ab35.Checked = check;
                        break;
                    case 36:
                        ab36.Checked = check;
                        break;
                    case 37:
                        ab37.Checked = check;
                        break;
                    case 38:
                        ab38.Checked = check;
                        break;
                    case 39:
                        ab39.Checked = check;
                        break;
                    case 40:
                        ab40.Checked = check;
                        break;
                    case 41:
                        ab41.Checked = check;
                        break;
                    case 42:
                        ab42.Checked = check;
                        break;
                    case 43:
                        ab43.Checked = check;
                        break;
                    case 44:
                        ab44.Checked = check;
                        break;
                    case 45:
                        ab45.Checked = check;
                        break;
                    case 46:
                        ab46.Checked = check;
                        break;
                    case 47:
                        ab47.Checked = check;
                        break;
                    case 48:
                        ab48.Checked = check;
                        break;
                    case 49:
                        ab49.Checked = check;
                        break;
                    case 50:
                        ab50.Checked = check;
                        break;
                    case 51:
                        ab51.Checked = check;
                        break;
                    case 52:
                        ab52.Checked = check;
                        break;
                    case 53:
                        ab53.Checked = check;
                        break;
                    case 54:
                        ab54.Checked = check;
                        break;
                    case 55:
                        ab55.Checked = check;
                        break;
                    case 56:
                        ab56.Checked = check;
                        break;
                    case 57:
                        ab57.Checked = check;
                        break;
                    case 58:
                        ab58.Checked = check;
                        break;
                    case 59:
                        ab59.Checked = check;
                        break;
                    case 60:
                        ab60.Checked = check;
                        break;
                    default:
                        break;
                }
            }
        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["RID"] != null)
            {
                ibo.Delete(int.Parse(Request.QueryString["RID"].ToString()));
                Model.Inapplicable app = new Model.Inapplicable();
                app.CREATETIME = DateTime.Now;
                app.CREATEUSER = CurrentUser.Id;
                app.PPARID = int.Parse(Request.QueryString["RID"].ToString());

                sbo.Delete(int.Parse(Request.QueryString["RID"].ToString()));
                SetLevel set = new SetLevel();
                set.CREATETIME = DateTime.Now;
                set.CREATEUSER = CurrentUser.Id;
                set.PPARID = int.Parse(Request.QueryString["RID"].ToString());
                set.TYPE = 3;

                //if (CheckBox1.Checked)
                //{
                //    app.NO = int.Parse(CheckBox1.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox2.Checked)
                //{
                //    app.NO = int.Parse(CheckBox2.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox3.Checked)
                //{
                //    app.NO = int.Parse(CheckBox3.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox4.Checked)
                //{
                //    app.NO = int.Parse(CheckBox4.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox5.Checked)
                //{
                //    app.NO = int.Parse(CheckBox5.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox6.Checked)
                //{
                //    app.NO = int.Parse(CheckBox6.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox7.Checked)
                //{
                //    app.NO = int.Parse(CheckBox7.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox8.Checked)
                //{
                //    app.NO = int.Parse(CheckBox8.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox9.Checked)
                //{
                //    app.NO = int.Parse(CheckBox9.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox10.Checked)
                //{
                //    app.NO = int.Parse(CheckBox10.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox11.Checked)
                //{
                //    app.NO = int.Parse(CheckBox11.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox12.Checked)
                //{
                //    app.NO = int.Parse(CheckBox12.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox13.Checked)
                //{
                //    app.NO = int.Parse(CheckBox13.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox14.Checked)
                //{
                //    app.NO = int.Parse(CheckBox14.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox15.Checked)
                //{
                //    app.NO = int.Parse(CheckBox15.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox16.Checked)
                //{
                //    app.NO = int.Parse(CheckBox16.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox17.Checked)
                //{
                //    app.NO = int.Parse(CheckBox17.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox18.Checked)
                //{
                //    app.NO = int.Parse(CheckBox18.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox19.Checked)
                //{
                //    app.NO = int.Parse(CheckBox19.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox20.Checked)
                //{
                //    app.NO = int.Parse(CheckBox20.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox21.Checked)
                //{
                //    app.NO = int.Parse(CheckBox21.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox22.Checked)
                //{
                //    app.NO = int.Parse(CheckBox22.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox23.Checked)
                //{
                //    app.NO = int.Parse(CheckBox23.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox24.Checked)
                //{
                //    app.NO = int.Parse(CheckBox24.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox25.Checked)
                //{
                //    app.NO = int.Parse(CheckBox25.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox26.Checked)
                //{
                //    app.NO = int.Parse(CheckBox26.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox27.Checked)
                //{
                //    app.NO = int.Parse(CheckBox27.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox28.Checked)
                //{
                //    app.NO = int.Parse(CheckBox28.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox29.Checked)
                //{
                //    app.NO = int.Parse(CheckBox29.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox30.Checked)
                //{
                //    app.NO = int.Parse(CheckBox30.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox31.Checked)
                //{
                //    app.NO = int.Parse(CheckBox31.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox32.Checked)
                //{
                //    app.NO = int.Parse(CheckBox32.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox33.Checked)
                //{
                //    app.NO = int.Parse(CheckBox33.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox34.Checked)
                //{
                //    app.NO = int.Parse(CheckBox34.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox35.Checked)
                //{
                //    app.NO = int.Parse(CheckBox35.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox36.Checked)
                //{
                //    app.NO = int.Parse(CheckBox36.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox37.Checked)
                //{
                //    app.NO = int.Parse(CheckBox37.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox38.Checked)
                //{
                //    app.NO = int.Parse(CheckBox38.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox39.Checked)
                //{
                //    app.NO = int.Parse(CheckBox39.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox40.Checked)
                //{
                //    app.NO = int.Parse(CheckBox40.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox41.Checked)
                //{
                //    app.NO = int.Parse(CheckBox41.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox42.Checked)
                //{
                //    app.NO = int.Parse(CheckBox42.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox43.Checked)
                //{
                //    app.NO = int.Parse(CheckBox43.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox44.Checked)
                //{
                //    app.NO = int.Parse(CheckBox44.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox45.Checked)
                //{
                //    app.NO = int.Parse(CheckBox45.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox46.Checked)
                //{
                //    app.NO = int.Parse(CheckBox46.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox47.Checked)
                //{
                //    app.NO = int.Parse(CheckBox47.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox48.Checked)
                //{
                //    app.NO = int.Parse(CheckBox48.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox49.Checked)
                //{
                //    app.NO = int.Parse(CheckBox49.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox50.Checked)
                //{
                //    app.NO = int.Parse(CheckBox50.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox51.Checked)
                //{
                //    app.NO = int.Parse(CheckBox51.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox52.Checked)
                //{
                //    app.NO = int.Parse(CheckBox52.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox53.Checked)
                //{
                //    app.NO = int.Parse(CheckBox53.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox54.Checked)
                //{
                //    app.NO = int.Parse(CheckBox54.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox55.Checked)
                //{
                //    app.NO = int.Parse(CheckBox55.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox56.Checked)
                //{
                //    app.NO = int.Parse(CheckBox56.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox57.Checked)
                //{
                //    app.NO = int.Parse(CheckBox57.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox58.Checked)
                //{
                //    app.NO = int.Parse(CheckBox58.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox59.Checked)
                //{
                //    app.NO = int.Parse(CheckBox59.ToolTip);
                //    ibo.Add(app);
                //}
                //if (CheckBox60.Checked)
                //{
                //    app.NO = int.Parse(CheckBox60.ToolTip);
                //    ibo.Add(app);
                //}


                //保存未选中的 level3
                if (!cb1.Checked&&cb1.Visible)
                {
                    set.NO = int.Parse(cb1.ToolTip);
                    sbo.Add(set);
                }
                if (!cb2.Checked && cb2.Visible)
                {
                    set.NO = int.Parse(cb2.ToolTip);
                    sbo.Add(set);
                }
                if (!cb3.Checked && cb3.Visible)
                {
                    set.NO = int.Parse(cb3.ToolTip);
                    sbo.Add(set);
                }
                if (!cb4.Checked && cb4.Visible)
                {
                    set.NO = int.Parse(cb4.ToolTip);
                    sbo.Add(set);
                }
                if (!cb5.Checked && cb5.Visible)
                {
                    set.NO = int.Parse(cb5.ToolTip);
                    sbo.Add(set);
                }
                if (!cb6.Checked && cb6.Visible)
                {
                    set.NO = int.Parse(cb6.ToolTip);
                    sbo.Add(set);
                }
                if (!cb7.Checked && cb7.Visible)
                {
                    set.NO = int.Parse(cb7.ToolTip);
                    sbo.Add(set);
                }
                if (!cb8.Checked && cb8.Visible)
                {
                    set.NO = int.Parse(cb8.ToolTip);
                    sbo.Add(set);
                }
                if (!cb9.Checked && cb9.Visible)
                {
                    set.NO = int.Parse(cb9.ToolTip);
                    sbo.Add(set);
                }
                if (!cb10.Checked && cb10.Visible)
                {
                    set.NO = int.Parse(cb10.ToolTip);
                    sbo.Add(set);
                }
                if (!cb11.Checked && cb11.Visible)
                {
                    set.NO = int.Parse(cb11.ToolTip);
                    sbo.Add(set);
                }
                if (!cb12.Checked && cb12.Visible)
                {
                    set.NO = int.Parse(cb12.ToolTip);
                    sbo.Add(set);
                }
                if (!cb13.Checked && cb13.Visible)
                {
                    set.NO = int.Parse(cb13.ToolTip);
                    sbo.Add(set);
                }
                if (!cb14.Checked && cb14.Visible)
                {
                    set.NO = int.Parse(cb14.ToolTip);
                    sbo.Add(set);
                }
                if (!cb15.Checked && cb15.Visible)
                {
                    set.NO = int.Parse(cb15.ToolTip);
                    sbo.Add(set);
                }
                if (!cb16.Checked && cb16.Visible)
                {
                    set.NO = int.Parse(cb16.ToolTip);
                    sbo.Add(set);
                }
                if (!cb17.Checked && cb17.Visible)
                {
                    set.NO = int.Parse(cb17.ToolTip);
                    sbo.Add(set);
                }
                if (!cb18.Checked && cb18.Visible)
                {
                    set.NO = int.Parse(cb18.ToolTip);
                    sbo.Add(set);
                }
                if (!cb19.Checked && cb19.Visible)
                {
                    set.NO = int.Parse(cb19.ToolTip);
                    sbo.Add(set);
                }
                if (!cb20.Checked && cb20.Visible)
                {
                    set.NO = int.Parse(cb20.ToolTip);
                    sbo.Add(set);
                }
                if (!cb21.Checked && cb21.Visible)
                {
                    set.NO = int.Parse(cb21.ToolTip);
                    sbo.Add(set);
                }
                if (!cb22.Checked && cb22.Visible)
                {
                    set.NO = int.Parse(cb22.ToolTip);
                    sbo.Add(set);
                }
                if (!cb23.Checked && cb23.Visible)
                {
                    set.NO = int.Parse(cb23.ToolTip);
                    sbo.Add(set);
                }
                if (!cb24.Checked && cb24.Visible)
                {
                    set.NO = int.Parse(cb24.ToolTip);
                    sbo.Add(set);
                }
                if (!cb25.Checked && cb25.Visible)
                {
                    set.NO = int.Parse(cb25.ToolTip);
                    sbo.Add(set);
                }
                if (!cb26.Checked && cb26.Visible)
                {
                    set.NO = int.Parse(cb26.ToolTip);
                    sbo.Add(set);
                }
                if (!cb27.Checked && cb27.Visible)
                {
                    set.NO = int.Parse(cb27.ToolTip);
                    sbo.Add(set);
                }
                if (!cb28.Checked && cb28.Visible)
                {
                    set.NO = int.Parse(cb28.ToolTip);
                    sbo.Add(set);
                }
                if (!cb29.Checked && cb29.Visible)
                {
                    set.NO = int.Parse(cb29.ToolTip);
                    sbo.Add(set);
                }
                if (!cb30.Checked && cb30.Visible)
                {
                    set.NO = int.Parse(cb30.ToolTip);
                    sbo.Add(set);
                }
                if (!cb31.Checked && cb31.Visible)
                {
                    set.NO = int.Parse(cb31.ToolTip);
                    sbo.Add(set);
                }
                if (!cb32.Checked && cb32.Visible)
                {
                    set.NO = int.Parse(cb32.ToolTip);
                    sbo.Add(set);
                }
                if (!cb33.Checked && cb33.Visible)
                {
                    set.NO = int.Parse(cb33.ToolTip);
                    sbo.Add(set);
                }
                if (!cb34.Checked && cb34.Visible)
                {
                    set.NO = int.Parse(cb34.ToolTip);
                    sbo.Add(set);
                }
                if (!cb35.Checked && cb35.Visible)
                {
                    set.NO = int.Parse(cb35.ToolTip);
                    sbo.Add(set);
                }
                if (!cb36.Checked && cb36.Visible)
                {
                    set.NO = int.Parse(cb36.ToolTip);
                    sbo.Add(set);
                }
                if (!cb37.Checked && cb37.Visible)
                {
                    set.NO = int.Parse(cb37.ToolTip);
                    sbo.Add(set);
                }
                if (!cb38.Checked && cb38.Visible)
                {
                    set.NO = int.Parse(cb38.ToolTip);
                    sbo.Add(set);
                }
                if (!cb39.Checked && cb39.Visible)
                {
                    set.NO = int.Parse(cb39.ToolTip);
                    sbo.Add(set);
                }
                if (!cb40.Checked && cb40.Visible)
                {
                    set.NO = int.Parse(cb40.ToolTip);
                    sbo.Add(set);
                }
                if (!cb41.Checked && cb41.Visible)
                {
                    set.NO = int.Parse(cb41.ToolTip);
                    sbo.Add(set);
                }
                if (!cb42.Checked && cb42.Visible)
                {
                    set.NO = int.Parse(cb42.ToolTip);
                    sbo.Add(set);
                }
                if (!cb43.Checked && cb43.Visible)
                {
                    set.NO = int.Parse(cb43.ToolTip);
                    sbo.Add(set);
                }
                if (!cb44.Checked && cb44.Visible)
                {
                    set.NO = int.Parse(cb44.ToolTip);
                    sbo.Add(set);
                }
                if (!cb45.Checked && cb45.Visible)
                {
                    set.NO = int.Parse(cb45.ToolTip);
                    sbo.Add(set);
                }
                if (!cb46.Checked && cb46.Visible)
                {
                    set.NO = int.Parse(cb46.ToolTip);
                    sbo.Add(set);
                }
                if (!cb47.Checked && cb47.Visible)
                {
                    set.NO = int.Parse(cb47.ToolTip);
                    sbo.Add(set);
                }
                if (!cb48.Checked && cb48.Visible)
                {
                    set.NO = int.Parse(cb48.ToolTip);
                    sbo.Add(set);
                }
                if (!cb49.Checked && cb49.Visible)
                {
                    set.NO = int.Parse(cb49.ToolTip);
                    sbo.Add(set);
                }
                if (!cb50.Checked && cb50.Visible)
                {
                    set.NO = int.Parse(cb50.ToolTip);
                    sbo.Add(set);
                }
                if (!cb51.Checked && cb51.Visible)
                {
                    set.NO = int.Parse(cb51.ToolTip);
                    sbo.Add(set);
                }
                if (!cb52.Checked && cb52.Visible)
                {
                    set.NO = int.Parse(cb52.ToolTip);
                    sbo.Add(set);
                }
                if (!cb53.Checked && cb53.Visible)
                {
                    set.NO = int.Parse(cb53.ToolTip);
                    sbo.Add(set);
                }
                if (!cb54.Checked && cb54.Visible)
                {
                    set.NO = int.Parse(cb54.ToolTip);
                    sbo.Add(set);
                }
                if (!cb55.Checked && cb55.Visible)
                {
                    set.NO = int.Parse(cb55.ToolTip);
                    sbo.Add(set);
                }
                if (!cb56.Checked && cb56.Visible)
                {
                    set.NO = int.Parse(cb56.ToolTip);
                    sbo.Add(set);
                }
                if (!cb57.Checked && cb57.Visible)
                {
                    set.NO = int.Parse(cb57.ToolTip);
                    sbo.Add(set);
                }
                if (!cb58.Checked && cb58.Visible)
                {
                    set.NO = int.Parse(cb58.ToolTip);
                    sbo.Add(set);
                }
                if (!cb59.Checked && cb59.Visible)
                {
                    set.NO = int.Parse(cb59.ToolTip);
                    sbo.Add(set);
                }
                if (!cb60.Checked && cb60.Visible)
                {
                    set.NO = int.Parse(cb60.ToolTip);
                    sbo.Add(set);
                }


                //保存未选中的 level2
                set.TYPE = 2;
                if (!eb1.Checked&&eb1.Visible)
                {
                    set.NO = int.Parse(eb1.ToolTip);
                    sbo.Add(set);
                }
                if (!eb2.Checked && eb2.Visible)
                {
                    set.NO = int.Parse(eb2.ToolTip);
                    sbo.Add(set);
                }
                if (!eb3.Checked && eb3.Visible)
                {
                    set.NO = int.Parse(eb3.ToolTip);
                    sbo.Add(set);
                }
                if (!eb4.Checked && eb4.Visible)
                {
                    set.NO = int.Parse(eb4.ToolTip);
                    sbo.Add(set);
                }
                if (!eb5.Checked && eb5.Visible)
                {
                    set.NO = int.Parse(eb5.ToolTip);
                    sbo.Add(set);
                }
                if (!eb6.Checked && eb6.Visible)
                {
                    set.NO = int.Parse(eb6.ToolTip);
                    sbo.Add(set);
                }
                if (!eb7.Checked && eb7.Visible)
                {
                    set.NO = int.Parse(eb7.ToolTip);
                    sbo.Add(set);
                }
                if (!eb8.Checked && eb8.Visible)
                {
                    set.NO = int.Parse(eb8.ToolTip);
                    sbo.Add(set);
                }
                if (!eb9.Checked && eb9.Visible)
                {
                    set.NO = int.Parse(eb9.ToolTip);
                    sbo.Add(set);
                }
                if (!eb10.Checked && eb10.Visible)
                {
                    set.NO = int.Parse(eb10.ToolTip);
                    sbo.Add(set);
                }
                if (!eb11.Checked && eb11.Visible)
                {
                    set.NO = int.Parse(eb11.ToolTip);
                    sbo.Add(set);
                }
                if (!eb12.Checked && eb12.Visible)
                {
                    set.NO = int.Parse(eb12.ToolTip);
                    sbo.Add(set);
                }
                if (!eb13.Checked && eb13.Visible)
                {
                    set.NO = int.Parse(eb13.ToolTip);
                    sbo.Add(set);
                }
                if (!eb14.Checked && eb14.Visible)
                {
                    set.NO = int.Parse(eb14.ToolTip);
                    sbo.Add(set);
                }
                if (!eb15.Checked && eb15.Visible)
                {
                    set.NO = int.Parse(eb15.ToolTip);
                    sbo.Add(set);
                }
                if (!eb16.Checked && eb16.Visible)
                {
                    set.NO = int.Parse(eb16.ToolTip);
                    sbo.Add(set);
                }
                if (!eb17.Checked && eb17.Visible)
                {
                    set.NO = int.Parse(eb17.ToolTip);
                    sbo.Add(set);
                }
                if (!eb18.Checked && eb18.Visible)
                {
                    set.NO = int.Parse(eb18.ToolTip);
                    sbo.Add(set);
                }
                if (!eb19.Checked && eb19.Visible)
                {
                    set.NO = int.Parse(eb19.ToolTip);
                    sbo.Add(set);
                }
                if (!eb20.Checked && eb20.Visible)
                {
                    set.NO = int.Parse(eb20.ToolTip);
                    sbo.Add(set);
                }
                if (!eb21.Checked && eb21.Visible)
                {
                    set.NO = int.Parse(eb21.ToolTip);
                    sbo.Add(set);
                }
                if (!eb22.Checked && eb22.Visible)
                {
                    set.NO = int.Parse(eb22.ToolTip);
                    sbo.Add(set);
                }
                if (!eb23.Checked && eb23.Visible)
                {
                    set.NO = int.Parse(eb23.ToolTip);
                    sbo.Add(set);
                }
                if (!eb24.Checked && eb24.Visible)
                {
                    set.NO = int.Parse(eb24.ToolTip);
                    sbo.Add(set);
                }
                if (!eb25.Checked && eb25.Visible)
                {
                    set.NO = int.Parse(eb25.ToolTip);
                    sbo.Add(set);
                }
                if (!eb26.Checked && eb26.Visible)
                {
                    set.NO = int.Parse(eb26.ToolTip);
                    sbo.Add(set);
                }
                if (!eb27.Checked && eb27.Visible)
                {
                    set.NO = int.Parse(eb27.ToolTip);
                    sbo.Add(set);
                }
                if (!eb28.Checked && eb28.Visible)
                {
                    set.NO = int.Parse(eb28.ToolTip);
                    sbo.Add(set);
                }
                if (!eb29.Checked && eb29.Visible)
                {
                    set.NO = int.Parse(eb29.ToolTip);
                    sbo.Add(set);
                }
                if (!eb30.Checked && eb30.Visible)
                {
                    set.NO = int.Parse(eb30.ToolTip);
                    sbo.Add(set);
                }
                if (!eb31.Checked && eb31.Visible)
                {
                    set.NO = int.Parse(eb31.ToolTip);
                    sbo.Add(set);
                }
                if (!eb32.Checked && eb32.Visible)
                {
                    set.NO = int.Parse(eb32.ToolTip);
                    sbo.Add(set);
                }
                if (!eb33.Checked && eb33.Visible)
                {
                    set.NO = int.Parse(eb33.ToolTip);
                    sbo.Add(set);
                }
                if (!eb34.Checked && eb34.Visible)
                {
                    set.NO = int.Parse(eb34.ToolTip);
                    sbo.Add(set);
                }
                if (!eb35.Checked && eb35.Visible)
                {
                    set.NO = int.Parse(eb35.ToolTip);
                    sbo.Add(set);
                }
                if (!eb36.Checked && eb36.Visible)
                {
                    set.NO = int.Parse(eb36.ToolTip);
                    sbo.Add(set);
                }
                if (!eb37.Checked && eb37.Visible)
                {
                    set.NO = int.Parse(eb37.ToolTip);
                    sbo.Add(set);
                }
                if (!eb38.Checked && eb38.Visible)
                {
                    set.NO = int.Parse(eb38.ToolTip);
                    sbo.Add(set);
                }
                if (!eb39.Checked && eb39.Visible)
                {
                    set.NO = int.Parse(eb39.ToolTip);
                    sbo.Add(set);
                }
                if (!eb40.Checked && eb40.Visible)
                {
                    set.NO = int.Parse(eb40.ToolTip);
                    sbo.Add(set);
                }
                if (!eb41.Checked && eb41.Visible)
                {
                    set.NO = int.Parse(eb41.ToolTip);
                    sbo.Add(set);
                }
                if (!eb42.Checked && eb42.Visible)
                {
                    set.NO = int.Parse(eb42.ToolTip);
                    sbo.Add(set);
                }
                if (!eb43.Checked && eb43.Visible)
                {
                    set.NO = int.Parse(eb43.ToolTip);
                    sbo.Add(set);
                }
                if (!eb44.Checked && eb44.Visible)
                {
                    set.NO = int.Parse(eb44.ToolTip);
                    sbo.Add(set);
                }
                if (!eb45.Checked && eb45.Visible)
                {
                    set.NO = int.Parse(eb45.ToolTip);
                    sbo.Add(set);
                }
                if (!eb46.Checked && eb46.Visible)
                {
                    set.NO = int.Parse(eb46.ToolTip);
                    sbo.Add(set);
                }
                if (!eb47.Checked && eb47.Visible)
                {
                    set.NO = int.Parse(eb47.ToolTip);
                    sbo.Add(set);
                }
                if (!eb48.Checked && eb48.Visible)
                {
                    set.NO = int.Parse(eb48.ToolTip);
                    sbo.Add(set);
                }
                if (!eb49.Checked && eb49.Visible)
                {
                    set.NO = int.Parse(eb49.ToolTip);
                    sbo.Add(set);
                }
                if (!eb50.Checked && eb50.Visible)
                {
                    set.NO = int.Parse(eb50.ToolTip);
                    sbo.Add(set);
                }
                if (!eb51.Checked && eb51.Visible)
                {
                    set.NO = int.Parse(eb51.ToolTip);
                    sbo.Add(set);
                }
                if (!eb52.Checked && eb52.Visible)
                {
                    set.NO = int.Parse(eb52.ToolTip);
                    sbo.Add(set);
                }
                if (!eb53.Checked && eb53.Visible)
                {
                    set.NO = int.Parse(eb53.ToolTip);
                    sbo.Add(set);
                }
                if (!eb54.Checked && eb54.Visible)
                {
                    set.NO = int.Parse(eb54.ToolTip);
                    sbo.Add(set);
                }
                if (!eb55.Checked && eb55.Visible)
                {
                    set.NO = int.Parse(eb55.ToolTip);
                    sbo.Add(set);
                }
                if (!eb56.Checked && eb56.Visible)
                {
                    set.NO = int.Parse(eb56.ToolTip);
                    sbo.Add(set);
                }
                if (!eb57.Checked && eb57.Visible)
                {
                    set.NO = int.Parse(eb57.ToolTip);
                    sbo.Add(set);
                }
                if (!eb58.Checked && eb58.Visible)
                {
                    set.NO = int.Parse(eb58.ToolTip);
                    sbo.Add(set);
                }
                if (!eb59.Checked && eb59.Visible)
                {
                    set.NO = int.Parse(eb59.ToolTip);
                    sbo.Add(set);
                }
                if (!eb60.Checked && eb60.Visible)
                {
                    set.NO = int.Parse(eb60.ToolTip);
                    sbo.Add(set);
                }

                //保存未选中的 level1
                set.TYPE = 1;
                if (!db1.Checked&&db1.Visible)
                {
                    set.NO = int.Parse(db1.ToolTip);
                    sbo.Add(set);
                }
                if (!db2.Checked && db2.Visible)
                {
                    set.NO = int.Parse(db2.ToolTip);
                    sbo.Add(set);
                }
                if (!db3.Checked && db3.Visible)
                {
                    set.NO = int.Parse(db3.ToolTip);
                    sbo.Add(set);
                }
                if (!db4.Checked && db4.Visible)
                {
                    set.NO = int.Parse(db4.ToolTip);
                    sbo.Add(set);
                }
                if (!db5.Checked && db5.Visible)
                {
                    set.NO = int.Parse(db5.ToolTip);
                    sbo.Add(set);
                }
                if (!db6.Checked && db6.Visible)
                {
                    set.NO = int.Parse(db6.ToolTip);
                    sbo.Add(set);
                }
                if (!db7.Checked && db7.Visible)
                {
                    set.NO = int.Parse(db7.ToolTip);
                    sbo.Add(set);
                }
                if (!db8.Checked && db8.Visible)
                {
                    set.NO = int.Parse(db8.ToolTip);
                    sbo.Add(set);
                }
                if (!db9.Checked && db9.Visible)
                {
                    set.NO = int.Parse(db9.ToolTip);
                    sbo.Add(set);
                }
                if (!db10.Checked && db10.Visible)
                {
                    set.NO = int.Parse(db10.ToolTip);
                    sbo.Add(set);
                }
                if (!db11.Checked && db11.Visible)
                {
                    set.NO = int.Parse(db11.ToolTip);
                    sbo.Add(set);
                }
                if (!db12.Checked && db12.Visible)
                {
                    set.NO = int.Parse(db12.ToolTip);
                    sbo.Add(set);
                }
                if (!db13.Checked && db13.Visible)
                {
                    set.NO = int.Parse(db13.ToolTip);
                    sbo.Add(set);
                }
                if (!db14.Checked && db14.Visible)
                {
                    set.NO = int.Parse(db14.ToolTip);
                    sbo.Add(set);
                }
                if (!db15.Checked && db15.Visible)
                {
                    set.NO = int.Parse(db15.ToolTip);
                    sbo.Add(set);
                }
                if (!db16.Checked && db16.Visible)
                {
                    set.NO = int.Parse(db16.ToolTip);
                    sbo.Add(set);
                }
                if (!db17.Checked && db17.Visible)
                {
                    set.NO = int.Parse(db17.ToolTip);
                    sbo.Add(set);
                }
                if (!db18.Checked && db18.Visible)
                {
                    set.NO = int.Parse(db18.ToolTip);
                    sbo.Add(set);
                }
                if (!db19.Checked && db19.Visible)
                {
                    set.NO = int.Parse(db19.ToolTip);
                    sbo.Add(set);
                }
                if (!db20.Checked && db20.Visible)
                {
                    set.NO = int.Parse(db20.ToolTip);
                    sbo.Add(set);
                }
                if (!db21.Checked && db21.Visible)
                {
                    set.NO = int.Parse(db21.ToolTip);
                    sbo.Add(set);
                }
                if (!db22.Checked && db22.Visible)
                {
                    set.NO = int.Parse(db22.ToolTip);
                    sbo.Add(set);
                }
                if (!db23.Checked && db23.Visible)
                {
                    set.NO = int.Parse(db23.ToolTip);
                    sbo.Add(set);
                }
                if (!db24.Checked && db24.Visible)
                {
                    set.NO = int.Parse(db24.ToolTip);
                    sbo.Add(set);
                }
                if (!db25.Checked && db25.Visible)
                {
                    set.NO = int.Parse(db25.ToolTip);
                    sbo.Add(set);
                }
                if (!db26.Checked && db26.Visible)
                {
                    set.NO = int.Parse(db26.ToolTip);
                    sbo.Add(set);
                }
                if (!db27.Checked && db27.Visible)
                {
                    set.NO = int.Parse(db27.ToolTip);
                    sbo.Add(set);
                }
                if (!db28.Checked && db28.Visible)
                {
                    set.NO = int.Parse(db28.ToolTip);
                    sbo.Add(set);
                }
                if (!db29.Checked && db29.Visible)
                {
                    set.NO = int.Parse(db29.ToolTip);
                    sbo.Add(set);
                }
                if (!db30.Checked && db30.Visible)
                {
                    set.NO = int.Parse(db30.ToolTip);
                    sbo.Add(set);
                }
                if (!db31.Checked && db31.Visible)
                {
                    set.NO = int.Parse(db31.ToolTip);
                    sbo.Add(set);
                }
                if (!db32.Checked && db32.Visible)
                {
                    set.NO = int.Parse(db32.ToolTip);
                    sbo.Add(set);
                }
                if (!db33.Checked && db33.Visible)
                {
                    set.NO = int.Parse(db33.ToolTip);
                    sbo.Add(set);
                }
                if (!db34.Checked && db34.Visible)
                {
                    set.NO = int.Parse(db34.ToolTip);
                    sbo.Add(set);
                }
                if (!db35.Checked && db35.Visible)
                {
                    set.NO = int.Parse(db35.ToolTip);
                    sbo.Add(set);
                }
                if (!db36.Checked && db36.Visible)
                {
                    set.NO = int.Parse(db36.ToolTip);
                    sbo.Add(set);
                }
                if (!db37.Checked && db37.Visible)
                {
                    set.NO = int.Parse(db37.ToolTip);
                    sbo.Add(set);
                }
                if (!db38.Checked && db38.Visible)
                {
                    set.NO = int.Parse(db38.ToolTip);
                    sbo.Add(set);
                }
                if (!db39.Checked && db39.Visible)
                {
                    set.NO = int.Parse(db39.ToolTip);
                    sbo.Add(set);
                }
                if (!db40.Checked && db40.Visible)
                {
                    set.NO = int.Parse(db40.ToolTip);
                    sbo.Add(set);
                }
                if (!db41.Checked && db41.Visible)
                {
                    set.NO = int.Parse(db41.ToolTip);
                    sbo.Add(set);
                }
                if (!db42.Checked && db42.Visible)
                {
                    set.NO = int.Parse(db42.ToolTip);
                    sbo.Add(set);
                }
                if (!db43.Checked && db43.Visible)
                {
                    set.NO = int.Parse(db43.ToolTip);
                    sbo.Add(set);
                }
                if (!db44.Checked && db44.Visible)
                {
                    set.NO = int.Parse(db44.ToolTip);
                    sbo.Add(set);
                }
                if (!db45.Checked && db45.Visible)
                {
                    set.NO = int.Parse(db45.ToolTip);
                    sbo.Add(set);
                }
                if (!db46.Checked && db46.Visible)
                {
                    set.NO = int.Parse(db46.ToolTip);
                    sbo.Add(set);
                }
                if (!db47.Checked && db47.Visible)
                {
                    set.NO = int.Parse(db47.ToolTip);
                    sbo.Add(set);
                }
                if (!db48.Checked && db48.Visible)
                {
                    set.NO = int.Parse(db48.ToolTip);
                    sbo.Add(set);
                }
                if (!db49.Checked && db49.Visible)
                {
                    set.NO = int.Parse(db49.ToolTip);
                    sbo.Add(set);
                }
                if (!db50.Checked && db50.Visible)
                {
                    set.NO = int.Parse(db50.ToolTip);
                    sbo.Add(set);
                }
                if (!db51.Checked && db51.Visible)
                {
                    set.NO = int.Parse(db51.ToolTip);
                    sbo.Add(set);
                }
                if (!db52.Checked && db52.Visible)
                {
                    set.NO = int.Parse(db52.ToolTip);
                    sbo.Add(set);
                }
                if (!db53.Checked && db53.Visible)
                {
                    set.NO = int.Parse(db53.ToolTip);
                    sbo.Add(set);
                }
                if (!db54.Checked && db54.Visible)
                {
                    set.NO = int.Parse(db54.ToolTip);
                    sbo.Add(set);
                }
                if (!db55.Checked && db55.Visible)
                {
                    set.NO = int.Parse(db55.ToolTip);
                    sbo.Add(set);
                }
                if (!db56.Checked && db56.Visible)
                {
                    set.NO = int.Parse(db56.ToolTip);
                    sbo.Add(set);
                }
                if (!db57.Checked && db57.Visible)
                {
                    set.NO = int.Parse(db57.ToolTip);
                    sbo.Add(set);
                }
                if (!db58.Checked && db58.Visible)
                {
                    set.NO = int.Parse(db58.ToolTip);
                    sbo.Add(set);
                }
                if (!db59.Checked && db59.Visible)
                {
                    set.NO = int.Parse(db59.ToolTip);
                    sbo.Add(set);
                }
                if (!db60.Checked && db60.Visible)
                {
                    set.NO = int.Parse(db60.ToolTip);
                    sbo.Add(set);
                }

                pbo.UpdateInapplicable(Request.QueryString["RID"].ToString(),DropDownList1.SelectedValue);
                lbo.WriteLog(CurrentUser.Id, "Set Inapplicable", Request.QueryString["RID"].ToString());
                //if (Request.QueryString["type"] != null)
                //{
                //    Response.Write("<script language=javascript>top.frames['menu'].location.reload();</script>");
                //    Response.Write("<script>top.frames['mainFrame'].location='Inapplicable.aspx'</script>");
                //}
                //else

                if (Request.QueryString["type"] != null && Request.QueryString["Rid"] != null)
                {
                    MailTemplate mail = mbo.GetModel(17);
                    DataSet dsmail = mbo.GetEDM17(Request.QueryString["RID"].ToString());
                    if (mail != null && dsmail.Tables[0].Rows.Count > 0)
                    {
                        string title = mail.TITLE.Replace("{Part No.}", dsmail.Tables[0].Rows[0]["bdntpartno"].ToString());
                        title = title.Replace("{Part name}", dsmail.Tables[0].Rows[0]["bdntpartname"].ToString());
                        title = title.Replace("{Color}", dsmail.Tables[0].Rows[0]["color"].ToString());
                        try
                        {
                            base.SendEmailToUser(dsmail.Tables[0].Rows[0]["supplieradmin"].ToString(), title, mail.CONTENT, null);
                            lbo.WriteLog(CurrentUser.Id, "Send Email:" + dsmail.Tables[0].Rows[0]["supplieradmin"].ToString(), Request.QueryString["rid"].ToString());

                        }
                        catch (Exception ex)
                        {
                            AlertMessage(ex.Message.ToString());
                            lbo.WriteLog(CurrentUser.Id, "Send Email:" + ex.Message.ToString(), Request.QueryString["rid"].ToString());
                        }
                    }
                }

                AlertReflashOpener("save succeed");
            }
        }


    }
}